 import { ref } from 'vue'
import { onPageScroll } from '@dcloudio/uni-app';
export function useTopBarShow() {
    const topBarShow=ref(false);
	const barTransFun=(scrollTop)=>{
		console.log(scrollTop,'obj-----');
		if (scrollTop > 40) {
			topBarShow.value = true;
		} else {
			topBarShow.value= false;
		}
	}
	console.log(onPageScroll);
  onPageScroll(({ scrollTop })=>{
	  uni.$uv.throttle(()=>{
			console.log('执行')
			barTransFun(scrollTop)
		},1000,false)
  })
  console.log('obj-----',topBarShow.value);
  return { topBarShow}
}
 
 